﻿using System;

namespace Program16
{
    public class Program
    {
        //定义一个委托
        public delegate void SayHi(string name);
        static void Main(string[] args)
        {
            //调用中文打招呼
            Hello("张三", SayHiChinese);
            //调用英文打招呼
            Hello("Michael", SayHiEnglish);
        }

        public static void Hello(string name, SayHi delegateSayHi)
        {
            delegateSayHi(name);
        }
        public static void SayHiChinese(string name)
        {
            Console.WriteLine("{0},你好！身体如何？", name);
        }
        public static void SayHiEnglish(string name)
        {
            Console.WriteLine("How Are you?，{0}", name);
        }
    }
}
